<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__VIEW__/css/style1.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="__STATIC__/css/hdjs.css" />
<script type="text/javascript" src="__STATIC__/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/hdjs.min.js"></script>
<style>
	th,td{
		text-indent: 0px !important;
		text-align: center !important;
	}
	span{	display:inline !important;	}
</style>
<script language="javascript">
$(function(){	
	//导航切换
	$(".imglist li").click(function(){
		$(".imglist li.selected").removeClass("selected")
		$(this).addClass("selected");
	})	
})	
</script>
<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>
</head>


<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">商品管理</a></li>
    <li><a href="#">商品列表</a></li>
    
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
        <li class="click"><a href="{|U:'addGoods'}"><span><img src="__VIEW__/images/t01.png" /></span>添加</a></li>
        <li><span><img src="__VIEW__/images/t04.png" /></span><a href="{|U:'GoodsListImg/index'}" target="_blank">商品库存分布图</a></li>
        </ul>
    	<b style="color:red">注意:当删除商品时会将库存也删除。当修改商品时会先将原来的库存删除</b>
    </div>
    
    
    <table class="imgtable">
    
    <thead>
    <tr>
    <th width="100px;">ID</th>
    <th>缩略图</th>
    <th>商品名称</th>
    <th>价格</th>
    <th>库存</th>
    <th>点击次数</th>
    <th>货号</th>
    <!--<th>状态</th>-->
    <th>操作</th>
    </tr>
    </thead>
    
    <tbody>
    <foreach from="$goods" key="$key" value="$val">
    <tr>
    <td class="imgtd">{$val.gid}</td>
    <td ><img src="__ROOT__/{$val.goods_listimg}" style="margin:0" width="50" height="50" alt="" /></td>
    <td style="padding:5px 0;"><a href="#">{$val.goods_name}</a><p>发布时间：{$val.goods_uptime|date:'Y-m-d H:i:s',@@}</p></td>
    <td>商城价: {$val.shop_price}<p>市场价:<span style="display:inline;text-decoration:line-through; ">{$val.goods_market}</span></p></td>
    <td>{$val.goods_count}</td>
    <td>{$val.goods_click}</td>
    <td>{$val.goods_sn}</td>
    <!--<td><if value="$val.goods_status==1">正常<else/>下架</if></td>-->
    <td><if value="$val.goods_status==1">
    	<!--<a href="__CONTROLLER__/goodsStatus/gid/{$val.gid}/status/1" class="hd-btn hd-btn-info hd-btn-sm" gid="{$val.gid}" >下架</a>-->
    	<else/>
    	<a href="__CONTROLLER__/goodsStatus/gid/{$val.gid}/status/0" class="hd-btn hd-btn-info hd-btn-sm" gid="{$val.gid}" >上架</a></if>
    	<a href="__MODULE__/GoodsList/index/gid/{$val.gid}" class="hd-btn hd-btn-primary hd-btn-sm" style="display: inline;">库存列表</a> <a href="__CONTROLLER__/editGoods/gid/{$val.gid}" class="hd-btn hd-btn-success hd-btn-sm" style="display: inline;" >修改</a> <a href="javascript:delGoods({$val.gid})" class="hd-btn hd-btn-danger hd-btn-sm" style="display: inline;" >删除</a></td>
    <script>
    	
    </script>
    </tr>
     </foreach>
    
    </tbody>
    
    </table>
    
    
    
    
    
   <div class="hd-page">
   		{$page}
   </div>

    
    </div>
    
   
    
<script type="text/javascript">
	$('.imgtable tbody tr:odd').addClass('odd');
</script>
<script>
    function delGoods(gid) {
        hd_modal({
            width: 350,//宽度
            height: 200,//高度
            title: '提示',//标题
            content: '您确定要删除此件商品吗?<br />如果只是想不让他在页面上显示可以使用下架功能',//提示信息
            button: true,//显示按钮
            button_success: "确定",//确定按钮文字
            button_cancel: "关闭",//关闭按钮文字
            timeout: 0,//自动关闭时间 0：不自动关闭
            shade: false,//背景遮罩
            shadeOpacity: 0.9,//背景透明度
            success: function () {//点击确定后的事件
				location.href="__CONTROLLER__/delGoods/gid/"+gid;
            },
            cancel: function () {//点击关闭后的事件

            }
        });
    }
</script>

</body>

</html>
